import request from '../utils/request'
/**
 * 获取文章频道数据
 * @returns 
 */
export const getChannels = (params) => {
  return request({
    url: '/channels',
    method: 'get',
    params
  })
}
//获取文章数据列表
export const getArticleList = (params) => {
  return request({
    url: '/mp/articles',
    method: 'get',
    params
  })
}
// 删除
export const deleteArticle = (params) => {
  return request({
    url: '/mp/articles/' + params,
    method: 'delete',
  })
}
// 修改
export const editArticle = (id, params) => {
  return request({
    url: '/mp/articles/' + id + '?draft=false',
    method: 'put',
    params
  })
}
// 获取修改数据
export const getArticleDetail = (params) => {
  return request({
    url: '/mp/articles/' + params,
    method: 'get',
  })
}
// 发布
export const pubulishArticle = (data) => {
  return request({
    url: '/mp/articles?draft=false',
    method: 'post',
    data
  })
}